using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class BroadcstMap : EntityTypeConfiguration<Broadcst>
    {
        public BroadcstMap()
        {
            // Primary Key
            this.HasKey(t => t.REGNUM);

            // Properties
            this.Property(t => t.MESSAGE)
                .IsRequired()
                .HasMaxLength(254);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Broadcst");
            this.Property(t => t.REGNUM).HasColumnName("REGNUM");
            this.Property(t => t.MESSAGE).HasColumnName("MESSAGE");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
        }
    }
}
